//package com.alibaba.citrus.ots.sales.plan.service.impl;
//
//import com.alibaba.citrus.ots.platform.enhance.api.scitem.ScItemQueryService;
//import com.alibaba.citrus.ots.platform.enhance.dto.api.request.IdQueryRequest;
//import com.alibaba.citrus.ots.sales.plan.api.setting.SalesPlanScItemQueryService;
//import com.alibaba.citrus.ots.sales.plan.dto.api.request.*;
//import com.alibaba.citrus.ots.sales.plan.sdo.SalesPlanScItemSDO;
//import com.alibaba.citrus.ots.sales.plan.service.SalesPlanScItemMeshFlowService;
//import com.epoch.app.otsplatformenhance.model.dto.ScItemSDO;
//import com.alibaba.cz.base.tool.page.PageResult;
//import com.alibaba.cz.base.tool.result.Result;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.Resource;
//import java.util.List;
//import java.util.stream.Collectors;
//
///**
// * @author wangyibing
// */
//@Component
//public class SalesPlanScItemMeshFlowServiceImpl implements SalesPlanScItemMeshFlowService {
//    @Resource
//    private SalesPlanScItemQueryService salesPlanScItemQueryService;
//
//    @Resource
//    private ScItemQueryService scItemQueryService;
//
//    @Override
//    public Result<PageResult<List<SalesPlanScItemSDO>>> pageQueryProductPlanList(SalesPlanScItemPageQueryRequest salesPlanScItemPageQueryRequest) {
//        Result<PageResult<List<SalesPlanScItemSDO>>> pageResultResult = salesPlanScItemQueryService.pageQueryProductPlanList(salesPlanScItemPageQueryRequest);
//        PageResult<List<SalesPlanScItemSDO>> page = pageResultResult.getResult();
//        List<SalesPlanScItemSDO> content = page.getContent();
//        List<SalesPlanScItemSDO> sdoList = content.stream().map(item -> {
//            IdQueryRequest idQueryRequest = new IdQueryRequest();
//            idQueryRequest.setId(item.getScItemId());
//            try {
//                Result<ScItemSDO> scItemById = scItemQueryService.getScItemById(idQueryRequest);
//                ScItemSDO result = scItemById.getResult();
//                item.setScItemSDO(result);
//            } catch (Exception e) {
//                e.printStackTrace();
//                // 打印日志
//            }
//            return item;
//        }).collect(Collectors.toList());
//        PageResult<List<SalesPlanScItemSDO>> pageResult = PageResult.of(sdoList, sdoList.size());
//        return Result.success(pageResult);
//    }
//}
